package com.lianjinsu.shop.controller;

import com.lianjinsu.shop.controller.vo.Response;
import com.lianjinsu.shop.entity.Banner;
import com.lianjinsu.shop.service.BannerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("Noerify")
@RequiredArgsConstructor
public class BannerController {

    private final BannerService bannerService;

    @GetMapping("getBannerList")
    Response<List<Banner>> getBannerList(@RequestParam(defaultValue = "10") int limit) {
        return Response.ok(bannerService.bannerList(limit));
    }
}
